home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / dev / basic / asldemo.lha / ASLDEMO.TXT
Text File  |  1997-11-04  |  5KB  |  148 lines

  1. ;
  2. ; ASL FontRequester and ScreenRequester Demo
  3. ; (c) 1997 Ott M. Aaloe (ott@lbi.ee)
  4. ;
  5. ; Both requesters have many tags and orignal blitz
  6. ; commands just won't use them - so this example supports more
  7. ; tags. Note that not all tags are included. There are
  8. ; tons of them but I included only the ones I needed
  9. ; a the time...most importantly the default settings can now be
  10. ; set to a requester. And if you need some more tags then check out
  11. ; the C INCLUDE files or mail me and I could find them for you!
  12. ; Oh and you shoud have blitzlibs:amigalibs.res resident!
  13. ;
  14. ; Feel free to use any part of this code anywhere you want!
  15.  
  16.  
  17. NEWTYPE.SMode
  18.   DisplayID.l
  19.   DisplayWidth.l
  20.   DisplayHeight.l
  21.   DisplayDepth.w
  22.   OverscanType.w
  23. End NEWTYPE
  24.  
  25. NEWTYPE.FntRequester
  26.     tmp1.l    ; UBYTE      fo_Reserved0[8];
  27.     tmp2.l
  28.     ta_Name.l
  29.     ta_YSize.w    ;/* Returned TextAttr        */
  30.     ta_Style.b
  31.     ta_Flags.b
  32.     fo_FrontPen.b ; /* Returned front pen       */
  33.     fo_BackPen.b  ;  /* Returned back pen        */
  34. End NEWTYPE
  35.  
  36. #ASLSM_Window=$80080002               ; /* Parent Window        */
  37. #ASLSM_Screen=$80080028               ; /* Screen To open On If no Window   */
  38. #ASLSM_InitialLeftEdge=$80080003      ; /* Initial requester coordinates    */
  39. #ASLSM_InitialTopEdge=$80080004       ;
  40. #ASLSM_InitialWidth=$80080005         ; /* Initial requester dimensions     */
  41. #ASLSM_InitialHeight=$80080006
  42. #ASLSM_InitialDisplayID=$80080064     ; /* Initial display mode id     */
  43. #ASLSM_InitialDisplayWidth=$80080065  ; /* Initial display width       */
  44. #ASLSM_InitialDisplayHeight=$80080066 ; /* Initial display height      */
  45. #ASLSM_InitialDisplayDepth=$80080067  ; /* Initial display Depth       */
  46. #ASLSM_InitialOverscanType=$80080068  ; /* Initial Type of overscan    */
  47. #ASLSM_InitialInfoOpened=$8008006a    ; /* Info wndw initially opened? */
  48. #ASLSM_InitialInfoLeftEdge=$8008006b  ; /* Initial Info Window coords. */
  49. #ASLSM_InitialInfoTopEdge=$8008006c
  50. #ASLSM_DoWidth=$8008006d              ; /* Display Width gadget?       */
  51. #ASLSM_DoHeight=$8008006e             ; /* Display Height gadget?      */
  52. #ASLSM_DoDepth=$8008006f              ; /* Display Depth gadget?       */
  53. #ASLSM_DoOverscanType=$80080070       ; /* Display Overscan Type gadget?   */
  54.  
  55. #ASLFO_Window=$80080002               ; /* Parent Window        */
  56. #ASLFO_Screen=$80080028               ; /* Screen To open On If no Window   */
  57. #ASLFO_InitialLeftEdge=$80080003      ; /* Initial requester coordinates    */
  58. #ASLFO_InitialTopEdge=$80080004
  59. #ASLFO_InitialWidth=$80080005         ; /* Initial requester dimensions     */
  60. #ASLFO_InitialHeight=$80080006
  61. #ASLFO_InitialName=$8008000a          ; /* Initial contents of Name gadget  */
  62. #ASLFO_InitialSize=$8008000b          ; /* Initial contents of Size gadget  */
  63. #ASLFO_InitialFrontPen=$8008000e      ; /* Initial front pen        */
  64. #ASLFO_DoFrontPen=$8008002c           ; /* Display Front color selector?    */
  65. #ASLFO_MinHeight=$80080010            ; /* Minimum font height To display   */
  66. #ASLFO_MaxHeight=$80080011            ; /* Maximum font height To display   */
  67. #ASLFO_MaxFrontPen=$80080042          ; /* Max # of colors in front Palette */
  68.  
  69. Dim SMRtags.TagItem(16)
  70. Dim FNTtags.TagItem(12)
  71.  
  72.  
  73. SMRtags(0)\ti_Tag=#ASLSM_InitialLeftEdge,10
  74. SMRtags(1)\ti_Tag=#ASLSM_InitialTopEdge,10
  75. SMRtags(2)\ti_Tag=#ASLSM_InitialWidth,300
  76. SMRtags(3)\ti_Tag=#ASLSM_InitialHeight,200
  77. SMRtags(4)\ti_Tag=#ASLSM_InitialDisplayID,$29004
  78. SMRtags(5)\ti_Tag=#ASLSM_InitialDisplayDepth,3
  79. SMRtags(6)\ti_Tag=#ASLSM_InitialDisplayWidth,640
  80. SMRtags(7)\ti_Tag=#ASLSM_InitialDisplayHeight,512
  81. SMRtags(8)\ti_Tag=#ASLSM_InitialOverscanType,3
  82. SMRtags(9)\ti_Tag=#ASLSM_InitialInfoOpened,1
  83. SMRtags(10)\ti_Tag=#ASLSM_InitialInfoLeftEdge,350
  84. SMRtags(11)\ti_Tag=#ASLSM_InitialInfoTopEdge,50
  85. SMRtags(12)\ti_Tag=#ASLSM_DoDepth,1
  86. SMRtags(13)\ti_Tag=#ASLSM_DoOverscanType,1
  87. SMRtags(14)\ti_Tag=#ASLSM_DoWidth,1
  88. SMRtags(15)\ti_Tag=#ASLSM_DoHeight,1
  89.  
  90. ;
  91. ; ScreenMode requester returns the ScreenMode structure
  92. ;
  93.  
  94. *sreq.SMode=0
  95. *sreq=AllocAslRequest_(2,&SMRtags(0)\ti_Tag)
  96. ok.b=AslRequest_(*sreq,&SMRtags(0)\ti_Tag)
  97.  
  98. If ok<>0
  99.   NPrint "ModeID:",Hex$(*sreq\DisplayID)
  100.   NPrint "X Size:",*sreq\DisplayWidth
  101.   NPrint "Y Size:",*sreq\DisplayHeight
  102.   NPrint "Depth :",*sreq\DisplayDepth
  103.   NPrint "OScan :",*sreq\OverscanType
  104.   NPrint " "
  105. Else
  106.   NPrint "Aborted/Error!"
  107. EndIf
  108. If (*sreq) Then FreeAslRequest_(*sreq)
  109.  
  110. ClickMouse
  111.  
  112.  
  113. FNTtags(0)\ti_Tag=#ASLFO_InitialLeftEdge,10
  114. FNTtags(1)\ti_Tag=#ASLFO_InitialTopEdge,10
  115. FNTtags(2)\ti_Tag=#ASLFO_InitialWidth,350
  116. FNTtags(3)\ti_Tag=#ASLFO_InitialHeight,300
  117. FNTtags(4)\ti_Tag=#ASLFO_InitialName,"topaz.font"
  118. FNTtags(5)\ti_Tag=#ASLFO_InitialSize,11
  119. FNTtags(6)\ti_Tag=#ASLFO_InitialFrontPen,1
  120. FNTtags(7)\ti_Tag=#ASLFO_DoFrontPen,1
  121. FNTtags(8)\ti_Tag=#ASLFO_MinHeight,8
  122. FNTtags(9)\ti_Tag=#ASLFO_MaxHeight,80
  123. FNTtags(10)\ti_Tag=#ASLFO_MaxFrontPen,7
  124.  
  125. ;
  126. ; Font request returns the FontRequester (!) structure
  127. ;
  128.  
  129. *fntreq.FntRequester=0
  130. *fntreq=AllocAslRequest_(1,&FNTtags(0)\ti_Tag)
  131. ok.b=AslRequest_(*fntreq,&FNTtags(0)\ti_Tag)
  132.  
  133. If ok<>0
  134.   NPrint "Font name:'",Peek$(*fntreq\ta_Name),"'"
  135.   NPrint "Y size   :",*fntreq\ta_YSize
  136.   NPrint "Front Pen:",*fntreq\fo_FrontPen
  137. Else
  138.   NPrint "Aborted/Error!"
  139. EndIf
  140.  
  141. If (*fntreq) Then FreeAslRequest_(*fntreq)
  142.  
  143. ClickMouse
  144. End
  145.  
  146.  
  147.  
  148.